//
//  FZNativeObject.m
//  EnglishTalk
//
//  Created by 周晓雄 on 16/3/10.
//  Copyright © 2016年 Feizhu Tech. All rights reserved.
//

#import "FZNativeObject.h"
#import <SRLoginUser.h>

@implementation FZNativeObject
+(NSString*)getJSONStringFromNative
{
    SROCToJSModel*model=[[SROCToJSModel alloc]init];
    
    model.uid=[[SRLoginUser userID]intValue];
    model.uc_id=[[SRLoginUser commonUId]integerValue];
    model.email=[SRLoginUser email];
    model.nickname=[SRLoginUser nickname];
    model.mobile=[SRLoginUser mobile];
    model.avatar=[SRLoginUser avatar];
    model.sex=[SRLoginUser sex];
    model.area=[SRLoginUser area];
    model.school=[SRLoginUser school];
    model.school_str=[SRLoginUser schoolName];
    model.birthday=[SRLoginUser birthday];
    model.signature=[SRLoginUser signature];
    model.avatar_url=[SRLoginUser imageURL];
    model.type=[SRLoginUser type];
    model.identity=[SRLoginUser userSchoolInfoIdentity];

    NSDictionary*dic=[MTLJSONAdapter JSONDictionaryFromModel:model];
    
    NSData*data=[NSJSONSerialization dataWithJSONObject:dic options:kNilOptions error:nil];
    
    return [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
}
@end
